/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Anthares
 */
@Embeddable
public class TradProdPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "LANG_ID", nullable = false, length = 255)
    private String langId;

    @Basic(optional = false)
    @NotNull
    @Column(name = "PROD_ID", nullable = false)
    private int prodId;

    public TradProdPK() {
    }

    public TradProdPK(String langId, int prodId) {
        this.langId = langId;
        this.prodId = prodId;
    }

    public String getLangId() {
        return langId;
    }

    public void setLangId(String langId) {
        this.langId = langId;
    }

    public int getProdId() {
        return prodId;
    }

    public void setProdId(int prodId) {
        this.prodId = prodId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (langId != null ? langId.hashCode() : 0);
        hash += (int) prodId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TradProdPK)) {
            return false;
        }
        TradProdPK other = (TradProdPK) object;
        if ((this.langId == null && other.langId != null) || (this.langId != null && !this.langId.equals(other.langId))) {
            return false;
        }
        if (this.prodId != other.prodId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Model.TradProdPK[ langId=" + langId + ", prodId=" + prodId + " ]";
    }
    
}
